public class Student {
    private String id;
    private String name;
    private String gender;
    private Course selectedCourse;

    public Student(String id, String name, String gender) {
        this.id = id;
        this.name = name;
        this.gender = gender;
    }

    public void selectCourse(Course course) {
        this.selectedCourse = course;
        System.out.println(name + "同学选择了" + course.getCourseName() + "课程");
    }

    public void dropCourse() {
        if (selectedCourse != null) {
            System.out.println(name + "同学退选了" + selectedCourse.getCourseName() + "课程");
            selectedCourse = null;
        } else {
            System.out.println(name + "同学目前没有选课，无法退课");
        }
    }

    public void printCourseSchedule() {
        if (selectedCourse != null) {
            System.out.println("学生课表：");
            System.out.println("学生编号：" + id);
            System.out.println("课程名称：" + selectedCourse.getCourseName());
            System.out.println("上课地点：" + selectedCourse.getLocation());
            System.out.println("上课时间：" + selectedCourse.getTime());
            System.out.println("授课教师：" + selectedCourse.getTeacher().getName());
        } else {
            System.out.println(name + "同学目前没有选课，课表为空");
        }
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getGender() {
        return gender;
    }

    public Course getSelectedCourse() {
        return selectedCourse;
    }
}